    <script src="<?=$url_styles?>js/plugins/filevalidation/languages/jquery.validationEngine-en.js"></script>  
    <script src="<?=$url_styles?>js/plugins/filevalidation/jquery.validationEngine.js"></script>  
	   
    <script src="<?=$url_styles?>js/specific/login.js"></script>
    <script>
        $('.login_form form').submit(function(e){
            $.ajax({
               url: '<?=url_create('admin','login')?>',
               type: 'post',
               dataType: 'json',
               data: {
                   username: $('#username').val(),
                   password: $('#password').val(),
				   remember: $('#remember').val()
               },
               success: function(data){
                   if(data.state=='success'){
                       window.location = '<?=$reference?>';
                       //alert(data.reference);
                   }
                   else{
                       alert(data.message);
                   }
               }
            });
            return false;
        })
    </script>